package com.integralPerformance.controller;

import com.integralPerformance.common.Result;
import com.integralPerformance.pojo.form.add.AddApplicationManager;
import com.integralPerformance.pojo.form.update.UpdateApplicationManager;
import com.integralPerformance.pojo.query.ApplicationManagerQuery;
import com.integralPerformance.pojo.query.JobPositionQuery;
import com.integralPerformance.pojo.vo.ApplicationManagerVo;
import com.integralPerformance.pojo.vo.BaseVo;
import com.integralPerformance.pojo.vo.JobPositionVo;
import com.integralPerformance.service.impl.ApplicationManagerServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/s2/applicationManager")
@Tag(name = "！新：管理员-岗位申请管理表格控制器", description = "岗位申请管理表格控制器")
public class ApplicationManagerController {

    @Autowired
    ApplicationManagerServiceImpl applicationManagerService;

    @Operation(summary = "查询获取", description = "查询获取")
    @PostMapping("/getList")
    public Result<BaseVo<ApplicationManagerVo>> getList(@RequestBody ApplicationManagerQuery  applicationManagerQuery) {
        return applicationManagerService.getList(applicationManagerQuery);
    }

    @Operation(summary = "添加一个岗位申请", description = "添加一个岗位申请")
    @PostMapping("/addOne")
    public Result<String> addOne(@RequestBody AddApplicationManager addApplicationManager) {
        return applicationManagerService.addOne(addApplicationManager);
    }

    @Operation(summary = "修改一个岗位申请", description = "添加一个岗位申请")
    @PostMapping("/update")
    public Result<String> updateOne(@RequestBody UpdateApplicationManager updateApplicationManager) {
        return applicationManagerService.updateOne(updateApplicationManager);
    }

    @Operation(summary = "删除岗位申请", description = "删除岗位申请")
    @DeleteMapping("/deleteByIds")
    public Result<String> deleteByIds(@RequestBody List<Integer> list) {
        return applicationManagerService.deleteByIds(list);
    }

    @Operation(summary = "关闭岗位申请", description = "关闭岗位申请")
    @PostMapping("/closeByIds")
    public Result<String> closeByIds(@RequestBody List<Integer> list) {
        return applicationManagerService.closeByIds(list);
    }

    @Operation(summary = "开启岗位申请", description = "关闭岗位申请")
    @PostMapping("/openByIds")
    public Result<String> openByIds(@RequestBody List<Integer> list) {
        return applicationManagerService.openByIds(list);
    }

}
